package mod.luckymod;

import com.simibubi.create.foundation.data.CreateRegistrate;
import com.tterrag.registrate.util.entry.ItemEntry;
import mod.luckymod.items.SodiumEquipment;
import mod.luckymod.items.SodiumSword;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.Item;

import static com.simibubi.create.AllTags.forgeItemTag;

public class ModItems {
    private static final CreateRegistrate REGISTRATE = Luckymod.registrate();

    static {
        REGISTRATE.setCreativeTab(AllCreativeModeTabs.BASE_CREATIVE_TAB);
    }
    private static ItemEntry<Item> sodium(String name, String displayname) {
        return REGISTRATE.item(name, Item::new)
                .model((ctx, prov) -> {
                    // 动态创建基础物品模型
                    prov.generated(ctx, prov.modLoc("item/" + ctx.getName()));
                })
                .tag(forgeItemTag("metal/sodium"))
                .lang(displayname)
                .register();
    }
    public static final ItemEntry<SodiumEquipment> SODIUM_CHESTPLATE = REGISTRATE.item("sodium_chestplate",
                    properties -> new SodiumEquipment(ArmorItem.Type.CHESTPLATE, properties))
            .tag(forgeItemTag("sodium/equipment"))
            .model((ctx, prov) -> {
                // 动态创建基础物品模型
                prov.generated(ctx, prov.modLoc("item/" + ctx.getName()));
            })
            .lang("钠胸甲")
            .register();
    public static final ItemEntry<SodiumEquipment> SODIUM_HELMET = REGISTRATE.item("sodium_helmet",
                    properties -> new SodiumEquipment(ArmorItem.Type.HELMET, properties))
            .tag(forgeItemTag("sodium/equipment"))
            .model((ctx, prov) -> {
                // 动态创建基础物品模型
                prov.generated(ctx, prov.modLoc("item/" + ctx.getName()));
            })
            .lang("钠头盔")
            .register();
    public static final ItemEntry<SodiumEquipment> SODIUM_LEGGING = REGISTRATE.item("sodium_legging",
                    properties -> new SodiumEquipment(ArmorItem.Type.LEGGINGS, properties))
            .tag(forgeItemTag("sodium/equipment"))
            .model((ctx, prov) -> {
                // 动态创建基础物品模型
                prov.generated(ctx, prov.modLoc("item/" + ctx.getName()));
            })
            .lang("钠护腿")
            .register();
    public static final ItemEntry<SodiumEquipment> SODIUM_BOOTS = REGISTRATE.item("sodium_boots",
                    properties -> new SodiumEquipment(ArmorItem.Type.BOOTS, properties))
            .tag(forgeItemTag("sodium/equipment"))
            .model((ctx, prov) -> {
                // 动态创建基础物品模型
                prov.generated(ctx, prov.modLoc("item/" + ctx.getName()));
            })
            .lang("钠靴子")
            .register();
    public static final ItemEntry<SodiumSword> Sodium_Sword = REGISTRATE.item("sodium_sword",
                    SodiumSword::new)
            .tag(forgeItemTag("sodium/weapon"))
            .lang("钠剑")
            .register();
    public static final ItemEntry<Item> RAW_SODIUM =
            sodium("raw_sodium", "粗钠");
    public static final ItemEntry<Item> SODIUM_INGOT = sodium("sodium_ingot","钠锭");
    public static void register() {
    }
}
